#/*HEADER*******************************************************************
#***************************************************************************
#***
#***     Copyright (c) 2002 Sandbridge Technologies, Inc.
#***
#***                     All rights reserved
#***
#*** This software embodies materials and concepts which are confidential
#*** to Sandbridge Technologies, Inc. and is made available
#*** solely pursuant to the terms of a written license agreement with
#*** Sandbridge Technologies, Inc.
#***************************************************************************
#*END*************************************************************************/

# To activate files I/O for validation of UL vs. MatLab must '#define UL_VALIDATION'

#BOARD_FLAGS= -DWRAP_TX -DRPU -DSCALE_ADC -DRUN_ON_BOARD -DRF_ENABLE -DRX_AND_TX -DSAMSUNG_RF
BOARD_FLAGS= -DWRAP_TX -DRPU -DSCALE_ADC -DRUN_ON_BOARD  -DRX_AND_TX 
#-DREDUCE_FREQUENCY_TX

BUILD_DIR = .

SRC_DIR_TX = $(BUILD_DIR)/Source_files

INCLS	= -I$(BUILD_DIR)/Header_files -I../../Common_Header_files \
	-I../Common_Phy_Header_files \
	-I../../UART/Headers
#	-I../../Rf_Samsung_3500/Header_files
#-I../../Rf_2829_3500/Header_files

TXCSRCS = FnThread21.c FnThread22.c FnThread23.c \
	send_1mbps.c send_2mbps.c \
	send_header.c send_preamble.c send_sfd.c \
	txtables.c tx_functions.c tx_start_header_gen.c \
	send_55mbps.c send_11mbps.c crc32_sb.c  create_txthreads.c\
	thread_globals.c timer.c LTE_ConvEncode.c FnThread11.c FnThread13.c

CSRCS = $(TXCSRCS)

		
RM	= rm -f
EXT	= .a
PROGRAM	= wlan_tx${EXT}

OBJS 	= $(CSRCS:.c=.o)

CC	= "$(SBROOT)/bin/sbcc"
AS	= "$(SBROOT)/bin/sbcc"
AR	= "$(SBROOT)/bin/sb-ar"

#RPU_FLAGS = $(SBCCFLAGS)#modifi 2016.6.27
RPU_FLAGS = --march=sb3500

CFLAGS= $(INCLS) \
	$(BOARD_FLAGS) \
	-DNDEBUG=1 \
	-O3\
	--inline \
	--restrict \
	--noclean \
#	-ddmode

#-v
#-dvectinfo

default:	$(PROGRAM)

all:	$(PROGRAM)

$(PROGRAM): $(OBJS)
	$(AR) rf $@ $^

%.o:	$(SRC_DIR_TX)/%.c
	$(CC) -o $@ -c $(RPU_FLAGS) $(CFLAGS) $^

clean:
	$(RM) $(OBJS) $(PROGRAM) *.stackdump *~
	$(RM) *.s *.v *.o *.sbx *.nm *.dis
	$(RM) filteredOut.txt iqout.txt testout.txt

clobber: clean
	$(RM) profile.*
